	
	<h2>Galeria de Fotos <a  style="margin-left:400px;" href="<?PHP echo $this->url(array('action' => 'adicionar')); ?>">Adicionar imagem</a></h2>
	<div class="forms-admin">

	<table class="data display datatable" id="example">
		<thead class="tr-titulo">
			<tr>
				<th  align="center">Imagem</th>
				<th  align="center">Descrição</th>
				<th  align="center">Galeria</th>
				<th align="center">Editar</th>
				<th align="center">Remover</th>
			</tr>
		</thead>
	<tbody>
    
    <?PHP foreach ($this->paginator as $galeria): ?>
       
			<tr class="odd gradeX">
				<?php $imagem = 'galeria_fotos/thumbs/'. $galeria['id_foto'] . '.jpg';?>
                <?php if(file_exists($imagem)):?>
                <td align="center"><img width="100" height="100" src=<?php echo 'http://' . $_SERVER['HTTP_HOST'] . '/galeria_fotos/thumbs/'. $galeria['id_foto'] . '.jpg'; ?> alt="<?PHP echo $galeria['descricao']; ?>" title="<?PHP echo $galeria['descricao']; ?>" /></td>
                <?php else:?>
                <td align="center"><img width="100" height="100" src=<?php echo 'http://' . $_SERVER['HTTP_HOST'] . '/galeria_fotos/sem-foto.gif'; ?> alt="<?PHP echo $galeria['descricao']; ?>" title="<?PHP echo $galeria['descricao']; ?>" /></td>              
                <?php endif;?>
				<td  align="center"><?PHP echo $galeria['descricao']; ?></td>
				<td  align="center"><?PHP echo $this->GetGaleria($galeria['galeria']); ?></td>
				<td align="center"><a class="button white" href="<?PHP echo $this->url(array('action' => 'editar', 'id' => $galeria['id_foto'])); ?>">Editar</a></td>
				<td align="center"><a class="button red" href="<?PHP echo $this->url(array('action' => 'remover', 'id' => $galeria['id_foto'], 'dd' => $galeria['galeria'])); ?>">Remover</a></td>	
			</tr>
    <?PHP endforeach; ?>
</tbody>
		</table>
		
		
	<div class="paginator"><?PHP echo $this->paginator; ?></div>
